Use case: Wakeup from Stop/Sleep mode at end of measurement

Sequence diagram

  @startuml
  participant "User Application" as User
  participant "HAL DTS Driver" as DTS #19DD3A
  participant "PWR" as PWR
  participant "NVIC" as NVIC
  participant "HW" as HW

  == Process: non-blocking mode ==

  User -> DTS:HAL_DTS_Start_IT()
  User <-- DTS: HAL_OK
  User -> DTS: __HAL_DTS_Enable_IT()


  User -> PWR**: HAL_PWREx_EnterSTOP0Mode()
  hnote across #FFAAAA
  <font color=red> ENTER IN STOP MODE
  end note
  HW <-: External HW trigger
  note over HW
  <font color=blue>DTS start measuring Temperature in <color red> **stop mode**</color>...
  end note
  note over HW
  <font color=green>DTS complete measuring Temperature
  end note

  hnote across #99FF99
  <font color=black> WAKEUP FROM STOP MODE
  end note
  User <-- PWR:
  NVIC <- HW: end of measurement interrupt
  DTS <- NVIC : HAL_DTS_IRQHandler
  User <- DTS: HAL_DTS_EndCallback or \n HAL_DTS_AsyncEndCallback

  User --> DTS:
  DTS --> NVIC :

  User -> DTS:HAL_DTS_GetTemperature()
  User <-- DTS: HAL_OK

  User -> DTS:HAL_DTS_Stop_IT()
  User <-- DTS:HAL_OK

  @enduml

Key changes

  1. HAL2 uses per-sensor interrupt start/stop APIs (HAL_DTS_StartSensor_IT() and HAL_DTS_StopSensor_IT()).

  2. The HAL2 completion callback is consolidated as HAL_DTS_CpltCallback.